﻿using System.Linq;
using NHibernate.Linq;
using Ornament.NHibernates;

namespace Ornament.Messages.Dao.NHibernateImple
{
    public class DaoFactory : IDaoFactory
    {
        #region IDaoFactory Members

        /// <summary>
        /// 
        /// </summary>
        public IInfoDao InfoDao
        {
            get { return new InfoDao(); }
        }

        /// <summary>
        /// 
        /// </summary>
        public IInfoTypeDao InfoTypeDao
        {
            get { return new InfoTypeDao(); }
        }

        public IQueryable<Info> Infos
        {
            get { return SessionManager.Instance.CurrentSession.Query<Info>(); }
        }

        public IQueryable<InfoReadState> ReadStates
        {
            get { return SessionManager.Instance.CurrentSession.Query<InfoReadState>(); }
        }

        public IQueryable<InfoType> InfoTypes
        {
            get { return SessionManager.Instance.CurrentSession.Query<InfoType>(); }
        }

        public IInfoReaderDao InfoReaderDao
        {
            get { return new InfoReaderDao(); }
        }

        public IInfoReadStateDao InfoReadStateDao
        {
            get { return new InfoReadStateDao(); }
        }

        #endregion
    }
}